package com.sun.BmobDemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class LoginActivity extends ActionBarActivity implements View.OnClickListener{

    private TextView textView;
    private EditText editTextUsername;
    private EditText editTextPwd;
    private TextView textView2;
    private Button buttonLogin;
    private Button buttonReg;
    private TextView textViewFindPwd;

    private void assignViews() {
        textView = (TextView) findViewById(R.id.textView);
        editTextUsername = (EditText) findViewById(R.id.editText_username);
        editTextPwd = (EditText) findViewById(R.id.editText_pwd);
        textView2 = (TextView) findViewById(R.id.textView2);
        buttonLogin = (Button) findViewById(R.id.button_login);
        buttonReg = (Button) findViewById(R.id.button_reg);
        textViewFindPwd = (TextView) findViewById(R.id.textView_findPwd);


    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login_activity);
        assignViews();

        buttonLogin.setOnClickListener(this);
        buttonReg.setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.button_reg:
                Log.i("1", "注册");
                Intent toReg = new Intent(this,RegActivity.class);
                startActivity(toReg);
                break;
            case R.id.button_login:
                Toast.makeText(this, "fhfg", Toast.LENGTH_SHORT).show();
                break;
        }
    }

}
